#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("number.in" , "r" , stdin);
	freopen("number.out" , "w" , stdout);
	int sum = 0;
	char c = getchar();
	for(int i = 0 ; i < 8 ; i++){
		if(c - '0' == 1){
			sum = sum + 1; 
		}
		c = getchar();
	}
	cout << sum << endl;
	return 0;
}